﻿<!doctype html>
<html><!-- InstanceBegin template="/Templates/template1.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>店面设置</title>
<!-- InstanceEndEditable -->
<script type="text/javascript" src="../js/common.js"></script>
<link href="../css/Pager.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../js/jquery.pager.js"></script>
<script type="text/javascript" src="../js/gbRst.js"></script>
<script type="text/javascript" src="../js/utils.js"></script>
<script type="text/javascript" src="../js/checkLogin.js"></script>
<script type="text/javascript" src="../js/formValidator.js"></script>
<script type="text/javascript" src="../js/formValidatorRegex.js"></script>
<link href="../css/style.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../js/ImageBrowsing.js"></script> 
<script type="text/javascript" src="../js/ajaxfileupload.js"></script> 
<script type="text/javascript" src="../js/city.js"></script>
<script type="text/javascript" src="../js/operateType.js"></script>
<script type="text/javascript" src="../js/industryType.js"></script>
<script type="text/javascript" src="../js/shopType.js"></script>
	<script charset="utf-8" src="../js/kindeditor.js"></script>
	<script charset="utf-8" src="../js/lang/zh_CN.js"></script>
	<link rel="stylesheet" href="../css/default.css" />
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<style type="text/css">
#window_change p label span img{
    border: 1px solid #CCCCCC;
    height: 51px;
    vertical-align: middle;
    width: 75px;

}

</style>

<script type="text/javascript" >
function bclicks(obj){
	var $first=obj.parent("td").parent("tr").children("td:first");
	var id=$first.html();
	var name=$first.next().html();
	//$("#shopName").children("option").blur();
	getParamToshopS(id,name)
}
var pagecount = 0;
var count = 0;
var shopId="shopId";
var shopPageCount=0;
var shopCount=0;
var pageIndex=1;
var editor;
var indexStr;
$(function(){
	$("#shopIsChoosed").click(function(){
		if($("#shopIsChoosed").is(":checked")){
			$("#shopName").attr("disabled",false);
		}else{
			$("#shopName").attr("disabled",true);

		}
	})
	getProvince("provinceList");
	getoperateLarge("operateLargeList");
	getIndustry("IndustryList")
	getShopType("shopTypeList");
	addMargin($("#window3"));
	addMargin($("#window4"));
	addMargin($("#window5"));
	addMargin($("#window6"));

	browse('imgURL','imgSrc',75,51)
	browse('imgURL1','imgSrc1',75,51)
	browse('imgURL2','imgSrc2',75,51)
	browse('imgURL3','imgSrc3',75,51)
	browse('imgURL4','imgSrc4',75,51)
	
	$("#editIndex_btn").click( function(){
		var doflag=$("#doflag").val();
		$("#window_changeff,#yinying").show();
		editor= KindEditor.create('#editIndex', {
			pasteType : 2,
			width:670,
			height:400
		});
		editor.html(indexStr);
		addMargin($("#window_changeff"));
	})
	
	var flag=getIdByName('flag');
	if(flag==1){
		InitTable()
	}else if(flag==2){
		var name= getIdByName('name');
		var code=getIdByName('code');
		name= decodeURI(name);
		code=decodeURI(code)
		$("#searchname").val(name);
		$("#searchcode").val(code);
		var p=getIdByName('pageIndex');
		$("#searchstatus").val(getIdByName("searchstatus"))
		pageIndex=p;
		InitTable()
	}
})


function shopExits(id){
	var bloo=false
	$("#shopName").find("option").each(function(){
		
		if($(this).attr("value")===id){
			bloo= true;
			return bloo;
		}
	})
	return bloo;
}


function getParamToshopS(id,name){
	var bl=shopExits(id);
	if(!bl){
		
	var htm="<option value='"+id+"'>"+name+"</option>"
	$("#shopName").html(htm);
	}
	$("#shopName").val(id);
	closeShopShow();
}

function closeShopShow(){
	$("#shopShow,#yinying").hide();
	$("#searchName").val("")
}

function InitShopList(shopPageIndex){
	var shopName=$("#searchName").val();
	$.ajax({
		type : "post",
		async:false,
		data :'name='+shopName,
		datatype : "json",
		url : "../shop/find/shopList/" + shopPageIndex + "/5",
		success : function(data) {
			var rst = JSON.parse(data); 
					 if(IsEmpty(rst)){
							art.dialog({fixed:true, lock: true,content:"查询出错",icon:'error',ok:true});	
							return false;
							}
							if(rst.state==0){
								$("#shopList tbody tr").remove();

								initShopTable(rst);
								$("table[id='shopList'] tbody tr").each(function(){
									$(this).children("td:last").css("text-align","center").append("<input type='button' class='common_btn' value='选择' onclick='bclicks($(this))'>");

								})	
								if(rst.result.len > 0){
									 var shu = rst.result.len;
									 shopCount = Math.ceil(shu/5);					
									 }else{
											shopCount==0;
									 }
								 $("#shopPager").pager({ pagenumber: ++shopPageIndex, pagecount: shopCount, buttonClickCallback: ShopPageClick });
								 addMargin($("#shopShow"));	
								 }else if(rst.state==1){
								art.dialog({fixed:true, lock: true,content:rst.msg,icon:'error',ok:true});	
							}else{
								checkStateShowErrorMsgAndDealResult(data);
							}
					
		}	
	});
	
		
	
}

function InitTable() {
	var name=$("#searchname").val().replace(/\s/gi,'');
	var code=$("#searchcode").val().replace(/\s/gi,'');
	var status=$("#searchstatus").val()
	var shopId="";
var param=null;
	if($("#shopIsChoosed").is(":checked")){	
		shopId=$("#shopName").val();
		if(shopId!=""&&shopId!=null){
		//	param+="&shopId="+shopId;
		 param=	{'name':name,'code':code,'status':status,'shopId':shopId}
		}else{
			 param=	{'name':name,'code':code,'status':status}
		}
	}else{
	 param=	{'name':name,'code':code,'status':status}
	}
	
	$.ajax({
		type : "get",
		async:false,
		data :param,
		datatype : "json",
		url : "../shop/find/allList/" + pageIndex + "/10",
		success : function(data) {
			var dt = JSON.parse(data);						
					 if(IsEmpty(dt)){
							art.dialog({fixed:true, lock: true,content:"查询出错",icon:'error',ok:true});	
							return false;
							}
							if(dt.state==0){
								$("#memberList tbody tr").remove();
								initTable(dt);
								if(dt.result.len > 0){
									 var shu = dt.result.len;
								 	 pagecount = Math.ceil(shu/10);
									$("#NoResult").hide();
								}else{
									$("#NoResult").show();
									pagecount=0;
								}
								$("#sup").html("共"+dt.result.len+"条");	
								 $("#pager").pager({ pagenumber: pageIndex, pagecount: pagecount, buttonClickCallback: PageClick });
								 }else if(dt.state==1){
								art.dialog({fixed:true, lock: true,content:dt.msg,icon:'error',ok:true});	
							
								 }else{
								checkStateShowErrorMsgAndDealResult(data);
							}			
					
					
					
		}	
	});
	
		
	
}

ShopPageClick = function(pageclickednumber) {
    $("#shopPager").pager({ pagenumber: --pageclickednumber, pagecount: pagecount, buttonClickCallback: PageClick });
    $("#result").html("Clicked Page " + pageclickednumber);
    InitShopList(pageclickednumber);
}

PageClick = function(pageclickednumber) {
	pageIndex=pageclickednumber;
	InitTable();
}

function search(){
	pageIndex=1;
	InitTable();
}
function search2(){
	InitShopList(0);
}
function initTable(json){
	if(json!=null && json.state==0){
		var params = new Array("imgURL", "code","name", "tel", "fax","email", "createTime", "staName");// "PayCash", "PayPos", "PayDepstAmt", "PayCheck", "PayPersonCard", "PayIntAmtMny", "StaName", "PaidName"
		Loadtable(json,params,"memberList");
	}
}



function initShopTable(json){
	if(json!=null && json.state==0){
		var params = new Array("id", "name","mp","contact");
		LoadShoptable(json,params,"shopList");
	}
}


function Loadtable(json, params, tableId){
	var phArray = new Array();
	var count = 0;
	if (params != null) {
		$(params).each(function(pIndex, pData) {
			$.each(json.result.head, function(hIndex, hData) {
				
				if (pData == hData) {
					phArray[count++] = hIndex;
				}
			});
		});
	}
	if (json.result.data != null) {
		$.each(json.result.data, function(index, dt) {
			$("table[id='" + tableId + "']").append("<tr></tr>");
			$(phArray).each(function(phIndex, data) {
				$.each($(dt), function(dtIndex, d) {
					if (dtIndex == data) {
						
						$("table[id='" + tableId + "'] tr:last").append("<td>" +  (d === null||d=="null" ? " " : d) + "</td>");
					}
				});
			});
		
		var id=getHeadIndexValue(index, json, "id")
		var htm="<td><input class='common_btn' type='button' onclick='toUpdate("+id+")' value='修改'><br> <input class='del common_btn' type='button' onclick='popPoint("+id+")' value='删除'>  </td>"
		$("table[id='" + tableId + "'] tbody tr:last").append(htm)
		});
		
	}
	
	$("table[id='" + tableId + "'] tbody tr").each(function(){
		var h=$(this).find("td:first").html();
		$(this).find("td:first").html("<img src='"+h+"?time="+(new Date()).getTime()+"' width='75' height='51' />")
	})
	
}
function LoadShoptable(json, params, tableId){
	var phArray = new Array();
	var count = 0;
	if (params != null) {
		$(params).each(function(pIndex, pData) {
			$.each(json.result.head, function(hIndex, hData) {
				
				if (pData == hData) {
					phArray[count++] = hIndex;
				}
			});
		});
	}
	if (json.result.data != null) {
		$.each(json.result.data, function(index, dt) {
			$("table[id='" + tableId + "']").append("<tr></tr>");
			$(phArray).each(function(phIndex, data) {
				$.each($(dt), function(dtIndex, d) {
					if (dtIndex == data) {                 
						$("table[id='" + tableId + "'] tr:last").append("<td>" +  (d === null||d=="null" ? " " : d) + "</td>");
					}
				});
			});
		});
		
	}
	


	
}

function showShopList(){
	$("#shopIsChoosed").attr("checked","checked");
	$("#shopName").blur();
	$("#shopShow,#yinying").show();
	InitShopList(0);
}


function  downRescouse(){
	var name=$("#name").val().replace(/\s/gi,'');
	var code=$("#code").val().replace(/\s/gi,'');
	var status=$("#status").val()
	var shopId="";
	var param="name="+name+"&code="+code+"&status="+status;
	if($("#shopIsChoosed").is(":checked")){

		
		shopId=$("#shopName").val();
		
		if(shopId!=""&&shopId!=null){
			param+="&shopId="+shopId;
		}
	}
	
		param+="&downType=6"
		
		window.location.href="../csvdown/down/csv/down?"+param

	}
	
function toAdd(){
	
	window.location.href="addShop.html?menu="+getIdByName("menu")+"&submenu="+getIdByName("submenu");
	/* 	retForm();
	$("#doflag").val(1);
	
	$("#yinying1,#window_change").show(); */

}
function toUpdate(id){
	window.location.href="makeShop.html?shopId="+id+"&name="+$("#searchname").val()+"&code="+$("#searchcode").val()+"&pageIndex="+pageIndex+"&searchstatus="+$("#searchstatus").val()+"&menu="+getIdByName("menu")+"&submenu="+getIdByName("submenu");
	
	/* retForm();
	$.ajax({
		type : "get",
		async:false,
		datatype : "json",
		url : "../shop/find/shopId/" + id,
		success : function(data) {
			var rst = JSON.parse(data);			
					 if(IsEmpty(rst)){
							art.dialog({fixed:true, lock: true,content:"获取数据出错",icon:'error',ok:true});	
							return false;
							}
							if(rst.state==0){
								var code=getHeadIndexValue(0, rst, "code");
								$("#code").val(IsEmpty(code)?"":code)
								var name=getHeadIndexValue(0, rst, "name");	
								$("#name").val(IsEmpty(name)?"":name)
								var sName=getHeadIndexValue(0, rst, "sName");	
								$("#sName").val(IsEmpty(sName)?"":sName)
								var indTypeId=getHeadIndexValue(0, rst, "indTypeId");	
								industryId = (IsEmpty(indTypeId)?null:indTypeId)
								var cid=getHeadIndexValue(0, rst, "cityId");
								cityId=(IsEmpty(cid)?null:cid)
								var shId=getHeadIndexValue(0, rst, "shopTypeId");	
								shopTypeId=(IsEmpty(shId)?null:shId)
								var opeId=getHeadIndexValue(0, rst, "operTypeId");	
								operateTypeId=(IsEmpty(opeId)?null:opeId)
								var opelId=getHeadIndexValue(0, rst, "OperateLargeTypeID");	
								operateLargeTypeId=(IsEmpty(opelId)?null:opelId)
								var ProID=getHeadIndexValue(0, rst, "ProvinceID");	
								provinceId=(IsEmpty(opelId)?null:ProID)
								var tel=getHeadIndexValue(0, rst, "tel");	
								var mp=getHeadIndexValue(0, rst, "mp");	
								$("#tel").val(IsEmpty(tel)?"":tel)
								$("#mp").val(IsEmpty(name)?"":mp)
								var fax=getHeadIndexValue(0, rst, "fax");	
								$("#fax").val(IsEmpty(fax)?"":fax)
								var email=getHeadIndexValue(0, rst, "email");	
								$("#email").val(IsEmpty(email)?"":email)
								var addr=getHeadIndexValue(0, rst, "addr");	
								$("#addr").val(IsEmpty(addr)?"":addr)
								var status=getHeadIndexValue(0, rst, "status");	
								$("#status").val(IsEmpty(name)?"":name)
								var indTypeName=getHeadIndexValue(0, rst, "indTypeName");	
								$("#industryName").val(IsEmpty(indTypeName)?"":indTypeName)
								var sTName=getHeadIndexValue(0, rst, "shopTypeName");	
								$("#shopTypeName").val(IsEmpty(sTName)?"":sTName)
								var opeName=getHeadIndexValue(0, rst, "operTypeName");	
								$("#operateTypeName").val(IsEmpty(opeName)?"":opeName)
								var provName=getHeadIndexValue(0, rst, "provName");	
								$("#provinceName").val(IsEmpty(provName)?"":provName)
								var CityName=getHeadIndexValue(0, rst, "CityName");	
								$("#cityName").val(IsEmpty(CityName)?"":CityName)
								var imgURL=getHeadIndexValue(0, rst, "imgURL");	
								var imgURL1=getHeadIndexValue(0, rst, "imgURL1");	
								var imgURL2=getHeadIndexValue(0, rst, "imgURL2");	
								var imgURL3=getHeadIndexValue(0, rst, "imgURL3");	
								var imgURL4=getHeadIndexValue(0, rst, "imgURL4");
								if(IsNotEmpty(imgURL)){	
									$("#imgSrc img").attr("src",imgURL)
									}
								if(IsNotEmpty(imgURL1)){	
										$("#imgSrc1 img").attr("src",imgURL1)
									}
								if(IsNotEmpty(imgURL2)){	
										$("#imgSrc2 img").attr("src",imgURL2)
									}
								if(IsNotEmpty(imgURL3)){	
										$("#imgSrc3 img").attr("src",imgURL3)
									}
								if(IsNotEmpty(imgURL4)){	
										$("#imgSrc4 img").attr("src",imgURL4)
									}	
								var regNo=getHeadIndexValue(0, rst, "regNo");	
								$("#regNo").val(IsEmpty(regNo)?"":regNo)
								var legal=getHeadIndexValue(0, rst, "legal");	
								$("#legal").val(IsEmpty(legal)?"":legal)
								var major=getHeadIndexValue(0, rst, "major");	
								$("#major").val(IsEmpty(major)?"":major)
								var memo=getHeadIndexValue(0, rst, "memo");	
								$("#memo").val(IsEmpty(major)?"":memo)
								var cardFlag=getHeadIndexValue(0, rst, "cardFlag");	
								$("#cardFlag").val(IsEmpty(cardFlag)?"":cardFlag)
								var lng=getHeadIndexValue(0, rst, "lng");	
								$("#lng").val(IsEmpty(lng)?"":lng)
								var lat=getHeadIndexValue(0, rst, "lat");	
								$("#lat").val(IsEmpty(lat)?"":lat)
								var oplarName=getHeadIndexValue(0, rst, "operateLargeName");	
								$("#operateLargeTypeName").val(IsEmpty(oplarName)?"":oplarName)
								$("#cardFlag").attr("disabled",true);
								$("#status").val(getHeadIndexValue(0, rst, "status"))
								$("#indexUrl").val(getHtmlString(getHeadIndexValue(0, rst, "idxUrl")))
								
								 }else if(rst.state==1){
								art.dialog({fixed:true, lock: true,content:rst.msg,icon:'error',ok:true});	
							
								 }else{
								checkStateShowErrorMsgAndDealResult(data);
							}				
					
		}	
	});
	$.ajax({
		type : "get",
		async:false,
		datatype : "json",
		url : "../htmlUtils/find/shophtmlStr/" + id + "/shopIndex",
		success : function(data) {
			var rst = JSON.parse(data);
					if(rst.state==0){
						indexStr=getHeadIndexValue(0, rst, "htmlStr");	
					}
		}	
	});
	$("#doflag").val(2);
	$("#updateId").val(id)
	
	$("#yinying1,#window_change").show(); */

}

function chooseProvince(id,pName){
	if(provinceId!=id){		
	$("#provinceName").val(pName);
	provinceId=id;
	$("#cityName").val("");
	cityId=null;
	}
	$("#yinying").hide();
	$("#window1").hide();
}
function chooseCity(id,name){
	
	cityId=id;
	$("#cityName").val(name);
	$("#yinying").hide();
	$("#window2").hide();

}
function showCityList(){
	if(IsEmpty(provinceId)){
		art.dialog({fixed:true, lock: true,content:"请先选择省份",icon:'error',ok:true});	
		return false;
	}
	getCity("cityList")
	showHideDiv('window2');
}
function chooseOperateLargeType(id,name){
	if(operateLargeTypeId!=id){		
		$("#operateLargeTypeName").val(name);
		operateLargeTypeId=id;
		$("#operateTypeName").val("");
		operateTypeId=null;
		}
		$("#yinying").hide();
		$("#window5").hide();
}
function showOperateType(){
	if(IsEmpty(operateLargeTypeId)){
		art.dialog({fixed:true, lock: true,content:"请先选择经营大类",icon:'error',ok:true});	
		return false;
	}
	 getOperateType("operateTypeList");
	 addMargin($("#window6"))
	 showHideDiv('window6');
}
function chooseOperateType(id,name){
	
	operateTypeId=id;
	$("#operateTypeName").val(name);
	$("#yinying").hide();
	$("#window6").hide();

}

function save(){
	var doflag=$("#doflag").val();
	if(doflag==1){
		addInfo();
	}else if(doflag==2){
		updateInfo();
	}else{
		art.dialog({fixed:true, lock: true,content:"页面出错",icon:'error',ok:true});	

		window.location.reload();
	}
}

function addInfo(){
	
	var name=$("#name").val().replace(/\s/gi,'');
	if(IsEmpty(name)){
		art.dialog({fixed:true, lock: true,content:"全称不能为空",icon:'error',ok:true});	

		$("#name").focus();
		return false
	}else{
		if(name.length>50){
			art.dialog({fixed:true, lock: true,content:"全称过长(50字以内)",icon:'error',ok:true});	
			$("#name").focus();
			return false	
		}
	}
	var code=$("#code").val().replace(/\s/gi,'');
	if(IsEmpty(code)){
		art.dialog({fixed:true, lock: true,content:"编码不能为空",icon:'error',ok:true});	

		$("#code").focus();
		return false
	}else{
		if(code.length>20){
			art.dialog({fixed:true, lock: true,content:"编码过长(20字以内)",icon:'error',ok:true});	
			$("#code").focus();
			return false	
		}
	}
	var sname=$("#sName").val().replace(/\s/gi,'');
	if(IsEmpty(sname)){
		art.dialog({fixed:true, lock: true,content:"简称不能为空",icon:'error',ok:true});	
		$("#sName").focus();
		return false
	}else{
		if(sname.length>10){
			art.dialog({fixed:true, lock: true,content:"简称过长(10字以内)",icon:'error',ok:true});	
			$("#sName").focus();
			return false	
		}
	}
	var fax=$("#fax").val().replace(/\s/gi,'');

	var tel=$("#tel").val().replace(/\s/gi,'');
	//var mp=$("#mp").val().replace(/\s/gi,'');
	var email=$("#email").val().replace(/\s/gi,'');
	if(IsNotEmpty(email)){
	   var reg=	/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
	   if(!reg.test(email)){
			art.dialog({fixed:true, lock: true,content:"邮箱格式错误",icon:'error',ok:true});	
			$("#email").focus();
			return false;
	   }
	}
	
	var addr=$("#addr").val().replace(/\s/gi,'');
	if(IsEmpty(addr)){
		art.dialog({fixed:true, lock: true,content:"地址不能为空",icon:'error',ok:true});	
		$("#addr").focus();
		return false;
	}
	
	var regNo=$("#regNo").val().replace(/\s/gi,'');
	if(IsEmpty(regNo)){
		art.dialog({fixed:true, lock: true,content:"工商号不能为空",icon:'error',ok:true});	
		$("#regNo").focus();
		return false;
	}else{
		if(regNo.length>20){
			art.dialog({fixed:true, lock: true,content:"工商号过长(20字以内)",icon:'error',ok:true});	
			$("#regNo").focus();
			return false;	
		}
	}
	
	var legal=$("#legal").val().replace(/\s/gi,'');
	var status=$("#status").val().replace(/\s/gi,'');
	var major=$("#major").val().replace(/\s/gi,'');
	if(IsNotEmpty(major)){
		if(major.length>4000){
			art.dialog({fixed:true, lock: true,content:"经营范围过长(4000字以内)",icon:'error',ok:true});	
			$("#major").focus();
			return false;	
		}
	}
	var memo=$("#memo").val().replace(/\s/gi,'');
	if(IsNotEmpty(memo)){
		if(memo.length>255){
			art.dialog({fixed:true, lock: true,content:"简介过长(256字以内)",icon:'error',ok:true});	
			$("#memo").focus();
			return false;	
		}
	}
	var cardFlag=$("#cardFlag").val().replace(/\s/gi,'');
	if(IsEmpty(cardFlag)){
		art.dialog({fixed:true, lock: true,content:"会员卡标识不能为空",icon:'error',ok:true});	
		$("#cardFlag").focus();
		return false;
	}else{
		if(cardFlag.length>10){
			art.dialog({fixed:true, lock: true,content:"会员卡标识过长(10字以内)",icon:'error',ok:true});	
			$("#cardFlag").focus();
			return false;	
		}
	}
	if(IsEmpty(industryId)){
		art.dialog({fixed:true, lock: true,content:"请选择行业类型",icon:'error',ok:true});	
		$("#industryName").val("");
		return false;
	}
	if(IsEmpty(shopTypeId)){
		art.dialog({fixed:true, lock: true,content:"请选择店铺类型",icon:'error',ok:true});	
		$("#shopTypeName").val("");
		return false;
	}if(IsEmpty(operateTypeId)){
		art.dialog({fixed:true, lock: true,content:"请选择经营类型",icon:'error',ok:true});	
		$("#operateTypeName").val("");
		return false;
	}if(IsEmpty(cityId)){
		art.dialog({fixed:true, lock: true,content:"请选择所在城市",icon:'error',ok:true});	
		$("#shopName").val("");
		return false;
	}
	
	var lat=$("#lat").val();
	var lng=$("#lng").val();
	if(IsEmpty(lat)||IsEmpty(lng)){
		art.dialog({fixed:true, lock: true,content:"请获得经纬度",icon:'error',ok:true});	
		return false;
	}
	
	var imgUrl=$("#imgURL").val();
	if(IsEmpty(imgUrl)){
		art.dialog({fixed:true, lock: true,content:"请选择品牌图",icon:'error',ok:true});	
		return false;
	}else{
		var reg=/(.*)\.(jpg|bmp|gif|ico|pcx|jpeg|tif|png|raw|tga)$/
		if(!reg.test(imgUrl)){
			art.dialog({fixed:true, lock: true,content:"请选择正确的图片",icon:'error',ok:true});	
			return false;	
		}
	}
	
	var heads=new Array("indTypeId","shopTypeID","operTypeID","code","name","sName","tel","fax","email","addr","status","regNo","legal","major","cardFlag","cityId","memo","lat","lng");
	var datas=new Array(industryId,shopTypeId,operateTypeId,code,name,sname,tel,fax,email,addr,status,regNo,legal,major,cardFlag,cityId,memo,lat,lng);
	var parser = new Object();
	var jsonParserStr = null;
	if (IsNotEmpty(datas)){
		addToParser(heads, datas, "add" , parser);
		jsonParserStr =  JSON.stringify(parser);
	}
	
	$("#close_this").attr("disabled",true)
	$.post("../shop/insert/insertInfo",{"data":jsonParserStr}, function(data) {
		$("#close_this").attr("disabled",false)
		var dt = JSON.parse(data);
		if(IsEmpty(dt)){
			art.dialog({fixed:true, lock: true,content:dt.msg,icon:'error',ok:true});	
			return false;
			}
			if(dt.state==0){
				var flag= addIndexHtml(getHtmlInt(getHeadIndexValue(0, dt, "id")));
				uploadImage(getHtmlInt(getHeadIndexValue(0, dt, "id")),"添加",flag)
				
			}else if(dt.state==1){
				art.dialog({fixed:true, lock: true,content:dt.msg,icon:'error',ok:true});	
			}else{
				checkStateShowErrorMsgAndDealResult(data); 
			}
		
	});
	
}
function addIndexHtml(id){
	var flag=0;
	if(IsNotEmpty(indexStr)){
		
		$.ajax({
			type : "post",
			async:false,
			data :{"htmlStr":indexStr},
			datatype : "json",
			url : "../htmlUtils/upload/htmlShopInit/"+id+"/shopIndex",
			success : function(data) {
				var rst = JSON.parse(data);
				if(rst.state==0){
					flag=0
				}else{
					flag=1;
				}
				
			}	
		});
		
	}
	return flag;
}

function updateInfo(){
	var id=$("#updateId").val()
	var name=$("#name").val().replace(/\s/gi,'');
	if(IsEmpty(name)){
		art.dialog({fixed:true, lock: true,content:"全称不能为空",icon:'error',ok:true});	

		$("#name").focus();
		return false
	}else{
		if(name.length>50){
			art.dialog({fixed:true, lock: true,content:"全称过长(50字以内)",icon:'error',ok:true});	
			$("#name").focus();
			return false	
		}
	}
	var code=$("#code").val().replace(/\s/gi,'');
	if(IsEmpty(code)){
		art.dialog({fixed:true, lock: true,content:"编码不能为空",icon:'error',ok:true});	

		$("#code").focus();
		return false
	}else{
		if(code.length>20){
			art.dialog({fixed:true, lock: true,content:"编码过长(20字以内)",icon:'error',ok:true});	
			$("#code").focus();
			return false	
		}
	}
	var sname=$("#sName").val().replace(/\s/gi,'');
	if(IsEmpty(sname)){
		art.dialog({fixed:true, lock: true,content:"简称不能为空",icon:'error',ok:true});	
		$("#sName").focus();
		return false
	}else{
		if(sname.length>10){
			art.dialog({fixed:true, lock: true,content:"简称过长(10字以内)",icon:'error',ok:true});	
			$("#sName").focus();
			return false	
		}
	}
	var fax=$("#fax").val().replace(/\s/gi,'');

	var tel=$("#tel").val().replace(/\s/gi,'');

	//var mp=$("#mp").val().replace(/\s/gi,'');
	var email=$("#email").val().replace(/\s/gi,'');
	if(IsNotEmpty(email)){
	   var reg=	/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
	   if(!reg.test(email)){
			art.dialog({fixed:true, lock: true,content:"邮箱格式错误",icon:'error',ok:true});	
			$("#email").focus();
			return false;
	   }
	}
	
	var addr=$("#addr").val().replace(/\s/gi,'');
	if(IsEmpty(addr)){
		art.dialog({fixed:true, lock: true,content:"地址不能为空",icon:'error',ok:true});	
		$("#addr").focus();
		return false;
	}
	
	var regNo=$("#regNo").val().replace(/\s/gi,'');
	if(IsEmpty(regNo)){
		art.dialog({fixed:true, lock: true,content:"工商号不能为空",icon:'error',ok:true});	
		$("#regNo").focus();
		return false;
	}else{
		if(regNo.length>20){
			art.dialog({fixed:true, lock: true,content:"工商号过长(20字以内)",icon:'error',ok:true});	
			$("#regNo").focus();
			return false;	
		}
	}
	
	var legal=$("#legal").val().replace(/\s/gi,'');
	var status=$("#status").val().replace(/\s/gi,'');
	var major=$("#major").val().replace(/\s/gi,'');
	if(IsNotEmpty(major)){
		if(major.length>4000){
			art.dialog({fixed:true, lock: true,content:"经营范围过长(4000字以内)",icon:'error',ok:true});	
			$("#major").focus();
			return false;	
		}
	}
	var memo=$("#memo").val().replace(/\s/gi,'');
	if(IsNotEmpty(memo)){
		if(memo.length>255){
			art.dialog({fixed:true, lock: true,content:"简介过长(256字以内)",icon:'error',ok:true});	
			$("#memo").focus();
			return false;	
		}
	}
	var cardFlag=$("#cardFlag").val().replace(/\s/gi,'');
	if(IsEmpty(cardFlag)){
		art.dialog({fixed:true, lock: true,content:"会员卡标识不能为空",icon:'error',ok:true});	
		$("#cardFlag").focus();
		return false;
	}else{
		if(cardFlag.length>10){
			art.dialog({fixed:true, lock: true,content:"会员卡标识过长(10字以内)",icon:'error',ok:true});	
			$("#cardFlag").focus();
			return false;	
		}
	}
	if(IsEmpty(industryId)){
		art.dialog({fixed:true, lock: true,content:"请选择行业类型",icon:'error',ok:true});	
		$("#industryName").val("");
		return false;
	}
	if(IsEmpty(shopTypeId)){
		art.dialog({fixed:true, lock: true,content:"请选择店铺类型",icon:'error',ok:true});	
		$("#shopTypeName").val("");
		return false;
	}if(IsEmpty(operateTypeId)){
		art.dialog({fixed:true, lock: true,content:"请选择经营类型",icon:'error',ok:true});	
		$("#operateTypeName").val("");
		return false;
	}if(IsEmpty(cityId)){
		art.dialog({fixed:true, lock: true,content:"请选择所在城市",icon:'error',ok:true});	
		$("#shopName").val("");
		return false;
	}
	
	var lat=$("#lat").val();
	var lng=$("#lng").val();
	if(IsEmpty(lat)||IsEmpty(lng)){
		art.dialog({fixed:true, lock: true,content:"请获得经纬度",icon:'error',ok:true});	
		return false;
	}
	
	
	var heads=new Array("indTypeId","shopTypeID","operTypeID","code","name","sName","tel","fax","email","addr","status","regNo","legal","major","cardFlag","cityId","memo","lat","lng","id");
	var datas=new Array(industryId,shopTypeId,operateTypeId,code,name,sname,tel,fax,email,addr,status,regNo,legal,major,cardFlag,cityId,memo,lat,lng,id);
	var parser = new Object();
	var jsonParserStr = null;
	if (IsNotEmpty(datas)){
		addToParser(heads, datas, "edit" , parser);
		jsonParserStr =  JSON.stringify(parser);
	}
	
	$("#close_this").attr("disabled",true)
	$.post("../shop/edit/editInfo",{"data":jsonParserStr}, function(data) {
		$("#close_this").attr("disabled",false)
		var dt = JSON.parse(data);
		if(IsEmpty(dt)){
			art.dialog({fixed:true, lock: true,content:"修改出错",icon:'error',ok:true});	
			return false;
			}
			if(dt.state==0){
			 var flag=addIndexHtml(id);
				uploadImage(id,"修改",flag);
			}else if(dt.state==1){
				art.dialog({fixed:true, lock: true,content:dt.msg,icon:'error',ok:true});	
			}else{
				checkStateShowErrorMsgAndDealResult(data);
			}
		
		
	});
	
}

function uploadImage( id,content,flag){
	
	var arrayObj = new Array();
	
	$.each($(".file"), function(index, filedata) {
		if ($(filedata).val().length > 0) {
			arrayObj.push($(filedata).attr("id"));
		}
	});
	
	if(arrayObj.length==0){
		if(flag>0){
			art.dialog({fixed:true, lock: true,content:"首页生成失败,请重新编辑",icon:'error',ok:true});			
			return false;
	
		}else{
			art.dialog({fixed:true, lock: true,content:"操作成功",icon:'succeed',ok:true});				
		pageIndex=1;
		InitTable();
		retForm();
		$("#yinying1,#window_change").hide();
		return false;
		}
	}
	
	$.ajaxFileUpload({
		url :"../shop/upload/images/"+id+"?ids="+arrayObj,
		secureuri : false,
		fileElementId : arrayObj,
		dataType : 'json',
		success : function(data){
			if (data.state == 0) {
				if(flag==0){				
				pageIndex=1;
					art.dialog({fixed:true, lock: true,content:"操作成功",icon:'succeed',ok:true});	
				InitTable();
				retForm();
				$("#yinying1,#window_change").hide();
				}else{
					$("#doflag").val(2);
					$("#updateId").val(id)
					art.dialog({fixed:true, lock: true,content:"首页生成失败,请重新编辑",icon:'error',ok:true});	
				}
			}else if(data.state == 1){
				$("#doflag").val(2);
				$("#updateId").val(id)
				if(flag==0){
						art.dialog({fixed:true, lock: true,content:"图片上传失败",icon:'error',ok:true});	
					}else{
						art.dialog({fixed:true, lock: true,content:"首页和图片上传失败,请重新编辑",icon:'error',ok:true});	
					}
			}
		},
		error : function(data) {
			art.dialog({fixed:true, lock: true,content:"图片上传失败",icon:'error',ok:true});	
			return false;
		}
	});

	browse('imgURL','imgSrc',75,51)
	browse('imgURL1','imgSrc1',75,51)
	browse('imgURL2','imgSrc2',75,51)
	browse('imgURL3','imgSrc3',75,51)
	browse('imgURL4','imgSrc4',75,51)
}
function chooseloadIndustryTable(iId,iName){
	industryId=iId
	$("#industryName").val(iName);
	$("#yinying").hide();
	$("#window3").hide();
}
function chooseShopType(ctId,ctName){
	shopTypeId=ctId;
	$("#shopTypeName").val(ctName);
	$("#yinying").hide();
	$("#window4").hide();
}

function retForm(){
	$("#code").val("");
	$("#name").val("");
	$("#sName").val("");
	$("#fax").val("");
	$("#tel").val("");
	$("#email").val("");
	$("#provinceName").val("");
	$("#cityName").val("");
	$("#cityName").val("");
	$("#regNo").val("");
	$("#legal").val("");
	$("#major").html("");
	$("#imgSrc img").attr("src","../images/logo.png");
	$("#imgSrc1 img").attr("src","../images/logo.png");
	$("#imgSrc2 img").attr("src","../images/logo.png");
	$("#imgSrc3 img").attr("src","../images/logo.png");
	$("#imgSrc4 img").attr("src","../images/logo.png");
	$("#cardFlag").attr("disabled",false);
	$(".file").val("");
	$("#cardFlag").val("");
	$("#operateLargeTypeName").val("")
	$("#operateTypeName").val("")
	$("#industryName").val("")
	$("#shopTypeName").val("");
	$("#doflag").val(1);
	$("#addr").val("");
	$("#memo").val("");
	$("#major").val("");
	$("#lat").val("");
	$("#lng").val("");
	$("#indexUrl").val("未编辑");
	$("#close_this").attr("disabled",false)
	indexStr=null;
	provinceId=null;
	provinceName=null;
	cityId=null;
	cityName=null;
	shopTypeId=null;
	shopTypeName=null;
	industryId=null;
	industryName=null;
	operateLargeTypeId=null;
	operateLargeTypeName=null;
	operateTypeId=null;
	operateTypeName=null;

}


function deleteInfo(id){
	
		$.post("../shop/del/deleteShop",{"id":id}, function(data) {
			var dt = JSON.parse(data);
			if(IsEmpty(dt)){
				art.dialog({fixed:true, lock: true,content:"删除出错",icon:'error',ok:true});	
				return false;
				}
				if(dt.state==0){
					InitTable();
					art.dialog({fixed:true, lock: true,content:"删除成功",icon:'succeed',ok:true});	
				}else if(dt.state==1){
					art.dialog({fixed:true, lock: true,content:dt.msg,icon:'error',ok:true});	
				}else{
					checkStateShowErrorMsgAndDealResult(data);
				}
		});
	
}

function findXY(){
	var address=$("#addr").val()
	if(IsEmpty(address)){
		art.dialog({fixed:true, lock: true,content:"请先输入地址再获得经纬度！",icon:'warning',ok:true});	
	
	}
	$("#lat").val("")
	$("#lng").val("")
	$.get("../sys/find/xy",{"address":address}, function(data) {
		var dt = JSON.parse(data);
		if(IsEmpty(dt)){
			art.dialog({fixed:true, lock: true,content:"查询出错",icon:'error',ok:true});	
			return false;
			}
			if(dt.state==0){
				$("#lat").val(dt.result.data[0][0])
				$("#lng").val(dt.result.data[0][1])
			}else if(dt.state==1){
				art.dialog({fixed:true, lock: true,content:dt.msg,icon:'error',ok:true});	
			}else{
				checkStateShowErrorMsgAndDealResult(data);
			}
	});
}



function saveHtml(){
	if(IsEmpty(editor)){
		indexStr="";
	}else{	
	indexStr=editor.html();
	}
	editor.remove("#editIndex")
	if(($("#doflag").val())==1){
		if(IsEmpty(indexStr)){
		$("#indexUrl").val("未编辑")
					
		}else{
			$("#indexUrl").val("已编辑")
	
		}
	}
	$("#window_changeff,#yinying").hide();
	}
function cancelHtml(){
	editor.remove("#editIndex")
	var doflag=$("#doflag").val();
	if(doflag==1){		
		if(IsNotEmpty(indexStr)){
			$("#indexUrl").val("已编辑");
		}else{
			$("#indexUrl").val("未编辑")
		}
		}
	$("#window_changeff,#yinying").hide();
}		
	
function popPoint(id){
	art.dialog({fixed:true, lock: true,content:"确认删除该条数据？",icon:'question',ok: function(){ deleteInfo(id)},cancel:true});
	}

	
</script>
</head>

<body>
<div id="yinying1"></div>
<div id="yinying"></div>
<div id="window_changeff" class="hideDiv"  style=" width:650px;background:#fff;z-index:400;"  >
	<textarea id="editIndex" name="editIndex"></textarea>
	<div class="BottomBtn">
        <input type="button"  value="确定" class="common_btn" onclick="saveHtml()" >
        <input type="button" value="取消" class="common_btn" style="background-color: red;" onclick="cancelHtml()" >
      </div>
</div>
<div id="shopShow" class="hideDiv">
    <div style="float:right;margin-bottom:5px;width:20px;height:20px;line-height:20px;text-align:center;background-color:#eee;margin-bottom:5px;border:1px solid #ccc;" > <span style="cursor: pointer;font-size: 14px;" onclick="closeShopShow();" >X</span> </div>
    <div class="bottom_search"><input type="text" id="searchName"><input type="button" style="width:auto;margin-left:5px;" value="查询" onclick="search2()"></div>
    <table   id="shopList" cellpadding="4" cellspacing="0" border="1" width="100%">
    <thead>
    <tr>
    <th>店面ID</th>
    <th>店面名称</th>
    <th>电话</th>
    <th>操作</th>
    </tr>
    </thead>
    </table>
    	<div id="shopPager"></div>
    </div>
<!-- InstanceBeginEditable name="EditRegion3" -->
<script type="text/javascript" src="../js/jquery.cityselect.js"></script>
<script type="text/javascript">
$(function(){
	$(".hideDiv").each(function(){
		addMargin($(this));
	})
	
});
</script>
<form id="valiForm" >
  <div id="window_change" class="member_search hideDiv" style="width:800px;">
    <div class="closeTop"><span class="closeThe" onclick="closeParent($(this))"><img src="../images/close.png"></span></div>
    <input type="hidden" id="doflag">
    <input type="hidden" id="shopflag">
    <input type="hidden" id="defaultCflag">
    <input type="hidden" id="updateId">
	<p style="white-space: nowrap;">
      <label><span>编码：</span>
        <input type="text" id="code">
      </label>
      <label><span>全称：</span>
        <input type="text" id="name">
      </label>
      <label><span>简称：</span>
        <input type="text" id="sName">
      </label>
    </p>
    <p>
      <label><span>传真：</span>
        <input type="text" id="fax">
      </label>
      <label><span>电话：</span>
        <input type="text" id="tel">
      </label>
      <label><span>邮箱：</span>
        <input type="text" id="email"></span>
      </label>
    </p>
    <p id="city_1">
		<label><span>省（市）：</span>
	<input type="text" onclick="showHideDiv('window1');" id="provinceName" readonly >
	</label>
		<label><span>城市（区）：</span>
		<input type="text" onclick="showCityList(); " id="cityName" readonly></label>
      <label><span>会员卡标识：</span>
        <input type="text" id="cardFlag" />
        </label>
	</p>
    <p>
      <label><span>工商注册号：</span>
        <input type="text" id="regNo">
      </label>
      <label><span>法定代表人：</span>
        <input type="text" id="legal">
      </label>
      <label><span>状态：</span>
        <select id="status"><option value="0">正常</option><option value="1">非正常</option></select>
      </label>
    </p>
    <p>
		<label><span>经营大类：</span>
		<input type="text" onclick="showHideDiv('window5');" id="operateLargeTypeName" readonly></label>
		<label><span>经营小类：</span>
		<input type="text" onclick="showOperateType();"  id="operateTypeName" readonly></label>
      <label><span>行业类型：</span>
        <input type="text" id="industryName" readonly onclick="showHideDiv('window3');">
      </label>
	</p>
    <p>
		<label><span>地址：</span>
        <input type="text" id="addr">
      </label>
      <label style="min-width:0;"><input type="button" value="获取坐标" class="btn" onclick="findXY()"></label>
      <label style="min-width:0;"><span style="min-width:0;">X:</span><input type="text" style="width:52px;" id="lat" readonly></label>
      <label style="min-width:0;"><span style="min-width:0;">Y:</span><input type="text" style="width:52px;" id="lng" readonly></label>
      <label><span>店面类型：</span>
        <input type="text" id="shopTypeName" readonly onclick="showHideDiv('window4');">
      </label>
    </p>
    <p>
		<label><span>店面首页：</span>
		<input type="text" id="indexUrl" readonly style="width:300px;"></label>
        <input type="button" value="编辑首页" class="btn" id="editIndex_btn" />
	</p>
    <p>
      <label><span>品牌图：</span>
        <span id="imgSrc" style="width:77px;height:53px;"><img src="../images/logo.png" class="popImg"  style="width: 75px;height: 51px"  ></span>
        <input type="button" value="选择" class="btn">
        <input type="file" class="file" id="imgURL" name="imgURL" >
      </label>
      <label><span>店面图一：</span>
        <span id="imgSrc1" style="width:77px;height:53px;"><img src="../images/logo.png" class="popImg"   style="width: 75px;height: 51px" /></span>
        <input type="button" value="选择" class="btn">
        <input type="file" class="file" id="imgURL1" name="imgURL1" >
      </label>
      <label><span>店面图二：</span>
        <span id="imgSrc2" style="width:77px;height:53px;"><img src="../images/logo.png" class="popImg"   style="width: 75px;height: 51px" /></span>
        <input type="button" value="选择" class="btn">
        <input type="file" class="file" id="imgURL2" name="imgURL2" >
      </label>
    </p>
    <p>
       <label><span>店面图三：</span>
        <span id="imgSrc3" style="width:77px;height:53px;"><img src="../images/logo.png" class="popImg"   style="width: 75px;height: 51px" /></span>
        <input type="button" value="选择" class="btn">
        <input type="file" class="file" id="imgURL3" name="imgURL3" >
      </label>
      <label><span>店面图四：</span>
        <span id="imgSrc4" style="width:77px;height:53px;"><img src="../images/logo.png" class="popImg"   style="width: 75px;height: 51px" /></span>
        <input type="button" value="选择" class="btn">
        <input type="file" class="file" id="imgURL4" name="imgURL4" >
      </label>
    </p>
    <p>
      <label><span>简介：</span>
        <textarea id="memo"></textarea>
      </label>
      <label><span>经营范围：</span>
        <textarea id="major"></textarea>
      </label>
    </p>
    
    <div class="submit_btn">
      <input type="button" value="保存信息"  onclick="save();" class="common_btn" id="close_this">
    </div>
  </div>
</form>
<!-- 省（市）-->
<div class="hideDiv hideOver" id="window1">
 <div class="closeTop"><span class="closeThe" onclick="closeParent($(this))"><img src="../images/close.png"></span></div>
	<table id="provinceList" width="100%" cellspacing="1" cellpadding="0" border="0" class="member_list">
    	<thead>
    	<tr>
        	<th>省份</th>
        	<th>操作</th>
        	<th>省份</th>
        	<th>操作</th>
        	<th>省份</th>
        	<th>操作</th>
        	<th>省份</th>
        	<th>操作</th>
        </tr>
        </thead>
        <tbody>
        	
        </tbody>
    </table>
</div>
<!-- 城市（区）-->
<div class="hideDiv hideOver" id="window2">
 <div class="closeTop"><span class="closeThe" onclick="closeParent($(this))"><img src="../images/close.png"></span></div>
	<table id="cityList" width="100%" cellspacing="1" cellpadding="0" border="0" class="member_list">
    	<caption>经营小类    </caption>
    	<thead>
    	<tr>
        	<th>城市</th>
        	<th>操作</th>
        	<th>城市</th>
        	<th>操作</th>
        	<th>城市</th>
        	<th>操作</th>
        	<th>城市</th>
        	<th>操作</th>
        </tr>
        </thead>
        <tbody>
        	
        </tbody>
    </table>
</div>
<!-- 行业类型 -->
<div class="hideDiv hideOver" id="window3">
 <div class="closeTop"><span class="closeThe" onclick="closeParent($(this))"><img src="../images/close.png"></span></div>
	<table id="IndustryList" width="100%" cellspacing="1" cellpadding="0" border="0" class="member_list">
    	<caption>行业类型       </caption>
    	<thead>
    	<tr>
        	<th>行业类型</th>
        	<th>操作</th>
        </tr>
        </thead>
        <tbody>
        	
        </tbody>
    </table>
    <div id="indusPager" class="shopPager"></div>
</div>
<!-- 店面类型 -->
<div class="hideDiv hideOver" id="window4">
 <div class="closeTop"><span class="closeThe" onclick="closeParent($(this))"><img src="../images/close.png"></span></div>
	<table id="shopTypeList" width="100%" cellspacing="1" cellpadding="0" border="0" class="member_list">
    	<caption>店面类型      </caption>
    	<thead>
    	<tr>
        	<th>店面类型</th>
        	<th>操作</th>
        </tr>
        </thead>
        <tbody>
        
        </tbody>
    </table>
</div>
<!-- 经营大类 -->
<div class="hideDiv hideOver" id="window5">
 <div class="closeTop"><span class="closeThe" onclick="closeParent($(this))"><img src="../images/close.png"></span></div>
	<table id="operateLargeList" width="100%" cellspacing="1" cellpadding="0" border="0" class="member_list">
    	<caption>经营大类       </caption>
    	<thead>
    	<tr>
        	<th>类别</th>
        	<th>操作</th>
        	<th>类别</th>
        	<th>操作</th>
        	<th>类别</th>
        	<th>操作</th>
        	<th>类别</th>
        	<th>操作</th>
        </tr>
        </thead>
        <tbody>
        	
        </tbody>
    </table>
</div>
<!-- 经营小类 -->
<div class="hideDiv hideOver" id="window6">
 <div class="closeTop"><span class="closeThe" onclick="closeParent($(this))"><img src="../images/close.png"></span></div>
	<table id="operateTypeList" width="100%" cellspacing="1" cellpadding="0" border="0" class="member_list">
    	<caption>经营小类         </caption>
    	<thead>
    	<tr>
        	<th>类别</th>
        	<th>操作</th>
        	<th>类别</th>
        	<th>操作</th>
        	<th>类别</th>
        	<th>操作</th>
        	<th>类别</th>
        	<th>操作</th>
        </tr>
        </thead>
        <tbody>
        	
        </tbody>
    </table>
</div>
<div class="container" id="container">
  <div class="container_R fr">
	<div class="place">店面设置</div>
    <div class="member_search">

    <p>
    <span>店铺名称：</span><input type="text" id="searchname" class="absoluteTxt"><span>店铺编码：</span><input type="text" id="searchcode" class="absoluteTxt"><span>状态：</span><select id="searchstatus" class="status"> <option value="">所有</option>  <option value="0">正常</option><option value="1">非正常</option></select><input type="button" value="查询" class="btn" onclick="search()"></p></div>
    
    <table width="100%" class="member_list" cellpadding="0" cellspacing="1" border="0" id="memberList">
    	<caption><strong>店面列表        <span id="sup">共0条</span> </strong>  <a href="javascript:void(0)" onclick="downRescouse();">导出数据</a> <input type="button" value="增加店面" onclick="toAdd()" class="common_btn addList"></caption>
    	<thead>
    	<tr>
    		<th width="50">品牌图</th>
        	<th width="30">编码</th>
        	<th width="50">名称</th>
        	<th width="50">电话</th>
        	<th width="50">传真</th>
        	<th width="50">邮箱</th>
        	<th width="50">建档时间</th>
        	<th width="36">状态</th>
        	<th width="40">操作</th>
        </tr>
        </thead>
        <tbody>
        	
        </tbody>
    </table>
    <div id="NoResult"  class="Nothing" style="text-align:center;display: none;">无符合条件的数据！</div>
    <div id="pager" style="float: right;"></div>
  </div>
  <div class="fc"></div>
</div>
<!-- InstanceEndEditable -->
<script type="text/javascript" src="../js/header.js"></script>
<script type="text/javascript" src="../js/left.js"></script>
<script type="text/javascript" src="../js/footer.js"></script>
<script type="text/javascript">
clearThis("absoluteTxt");
showTab(1,1);
</script>
</body>
<!-- InstanceEnd --></html>
